package com.atwork.wuhua.ui.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.atwork.wuhua.ConstantsMyself;
import com.atwork.wuhua.R;
import com.atwork.wuhua.adapter.ReplyAdapter;
import com.atwork.wuhua.base.BaseActivity;
import com.atwork.wuhua.bean.ReplyBean;
import com.atwork.wuhua.utils.LogUtils;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 回复
 */
public class ReplyActivity extends BaseActivity {
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.rv_reply)
    RecyclerView rvReply;


    private ImageView imgThumb;
    private TextView tvName, tvContent, tvTime;
    private ReplyAdapter replyAdapter;
    private List<ReplyBean> replyBeans;
    private String id;
    private View header;

    @Override
    protected boolean isBindEventBus() {
        return false;
    }

    @Override
    public int intiLayout() {
        return R.layout.activity_reply;
    }

    @Override
    public void initView() {
        if (getIntent().getExtras() != null) {
            id = getIntent().getExtras().getString(ConstantsMyself.INTENTID);
            LogUtils.e("id==>" + id);
        }
        tvTitle.setText("回复详情");
        header = LayoutInflater.from(this).inflate(R.layout.view_reply_header, null);
    }

    @Override
    public void initData() {
        replyBeans = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            replyBeans.add(new ReplyBean(i + ""));
        }
        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        rvReply.setLayoutManager(manager);
        replyAdapter = new ReplyAdapter(this, R.layout.item_reply, replyBeans);
        rvReply.setAdapter(replyAdapter);
        replyAdapter.addHeaderView(header);


    }


    @OnClick(R.id.img_left)
    public void onViewClicked() {
        finish();
    }
}
